package com.shop.user.controller.login;

import com.modular.result.RspMessage;
import com.shop.user.service.login.ILoginService;
import com.shop.user.vo.login.LoginReqVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user")
@Api(tags = "用户管理")
public class LoginController {
    @Autowired
    private ILoginService loginService;
    /**
     * 登录用户
     * @param reqVo
     * @return
     */
    @ApiOperation("用户登录")
    @PostMapping("login")
    public RspMessage<Void> login(@RequestBody LoginReqVo reqVo){
        loginService.login(reqVo);
        return RspMessage.success();
    }
}
